<?php
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Sol',
	'preload'=>array('log'),
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),
	'modules'=>array(
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'sol',
			'ipFilters'=>array('127.0.0.1','::1'),
		),
      'api',
      'acl',
      'cube' => array(
         'db'=>array(
            'class'=>'CDbConnection',
            'connectionString' => 'pgsql:host=localhost;port=5432;dbname=cube',
            'emulatePrepare' => true,
            'username' => 'postgres',
            'password' => 'admin',
            'charset' => 'utf8',
         ),
      )
   ),
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
         'loginUrl' => null
		),
		'urlManager'=>array(
			'urlFormat'=>'path',
         'showScriptName' => false,
			'rules'=>array(
            // REST patterns
            array('api/default/list',     'pattern'=>'api/<model:\w+>', 'verb'=>'GET'),
            array('api/default/view',     'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'GET'),
            array('api/default/update',   'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'PUT'),
            array('api/default/delete',   'pattern'=>'api/<model:\w+>/<id:\d+>', 'verb'=>'DELETE'),
            array('api/default/create',   'pattern'=>'api/<model:\w+>', 'verb'=>'POST'),
				// OTHER controllers
            '<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		'db'=>array(
			'connectionString' => 'pgsql:host=localhost;port=5432;dbname=sol',
			'emulatePrepare' => true,
			'username' => 'postgres',
			'password' => 'admin',
			'charset' => 'utf8',
		),
      'dbcube'=>array(
         'connectionString' => 'pgsql:host=localhost;port=5432;dbname=cube',
         'emulatePrepare' => true,
         'username' => 'postgres',
         'password' => 'admin',
         'charset' => 'utf8',
         'class'   => 'CDbConnection'   
      ),
      'clientScript'=>array(
         'packages'=>array(
            'jquery' => array(
               'baseUrl'=>'js',
               'js'=>array('jquery-1.9.1.min.js'),                    
            ),
            'jquery.ui'=>array(
               'baseUrl'=>'js',
               'js'=>array('jquery-ui-1.10.1.custom.min.js'),
               'depends'=>array('jquery')
            ),
            'wijmo'=>array(
               'baseUrl'=>'js',
               'js'=>array('jquery.wijmo-open.all.3.20131.1.min.js', 'jquery.wijmo-pro.all.3.20131.1.min.js'),
               'depends'=>array('jquery.ui')
            ),
            'underscore' => array(
               'baseUrl'=>'js',
               'js'=>array('underscore.1.4.4.min.js'),                    
            ),
            'json2' => array(
               'baseUrl'=>'js',
               'js'=>array('json2.js'),                    
            ),  
            'backbone' => array(
               'baseUrl'=>'js',
               'js'=>array('backbone.1.0.0.min.js'),
               'depends'=>array('jquery', 'underscore', 'json2')
            ),
            'layout' => array(
               'baseUrl'=>'js',
               'js'=>array('jquery.layout.1.3.0.3079.min.js'),
               'depends'=>array('jquery.ui')
            ),  
         )   
      ),
		// uncomment the following to use a MySQL database
		/*
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=testdrive',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),
		*/
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);